#!/usr/bin/env python
# -*- coding: utf-8 -*-

import vk
import os

from optparse import OptionParser
usage = """usage: %prog [options] <status message>"""
parser = OptionParser(usage=usage)
parser.add_option("-a", "--auth", dest="auth",
                  help="specify user login and password as <login>:<password>")
try:
    options, args = parser.parse_args(os.sys.argv)
    if len(args) != 2:
        raise Exception('lol')
except Exception as e:
    parser.parse_args([os.sys.argv[0], '-h'])
    os.sys.exit(-1)
if options.auth:
    try:
        login,password = options.auth.split(':')
    except Exception as e:
        parser.parse_args([os.sys.argv[0], '-h'])
        os.sys.exit(-1)
else:
    login, password = vk.get_static_auth()

session = vk.Vkontakte(login, password)
session.activity = args[1]
